
export const useLeftStore = defineStore("left", () => {
    // 生产运营-燃气
    const scyy_rq = ref([
        [
            {
                name: "门站",
                value: 10,
            },
            {
                name: "高压调压站",
                value: 102,
            },
            {
                name: "LNG气源站",
                value: 3,
            },
        ],
        [
            {
                name: "年度累计进气量",
                value: 10,
                unit: "万m³",
            },
            {
                name: "年度销气量",
                value: 102,
                unit: "万m³",
            },
            {
                name: "今日进气量",
                value: 102,
                unit: "万m³",
            },
            {
                name: "供销差",
                value: 102,
                unit: "%",
            },
        ],
    ]);

    // 生产运营-供热
    const scyy_gr = ref([
        [
            {
                name: "热电联产热源",
                value: 10,
                unit: "座",
            },
            {
                name: "区域热源",
                value: 102,
                unit: "座",
            },
            {
                name: "调峰热源",
                value: 102,
                unit: "座",
            },
            {
                name: "中继泵站",
                value: 102,
                unit: "座",
            },
        ],
        [
            {
                name: "热源瞬时热量",
                value: 102,
                unit: "万MW",
            },
            {
                name: "热源装机容量",
                value: 102,
                unit: "万MW",
            },
            {
                name: "本采暖季累积热量",
                value: 102,
                unit: "万GJ",
            },
        ],
    ]);
    // 燃气管线-饼图
    const spec = ref({
        color: ["#8630f5", "#6eb5ef", "#ffce00"],
        title: {
            text: "燃气管网总长度(万km)",
            left: "center",
            textStyle: {
                color: "#fff",
                fontSize: 20,
            },
            padding: 0,
            top: 5,
        },
        tooltip: {
            trigger: "item",
        },
        series: [
            {
                type: "pie",
                radius: ["40%", "60%"],
                data: [
                    { value: 1048, name: "低压管网" },
                    { value: 735, name: "中压管网" },
                    { value: 580, name: "高压管网" },
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: "rgba(0, 0, 0, 0.5)",
                    },
                },
                label: {
                    // formatter: '{a|{b}}\n  {b|{c}}{per|万㎡} ',
                    position: "outside",
                    formatter: "{a|{b}}\n  {b|{c}}",
                    backgroundColor: "#0b1c35",
                    borderColor: "inherit",
                    borderWidth: 1,
                    fontSize: 20,
                    borderRadius: 4,
                    rich: {
                        a: {
                            color: "#fff",
                            padding: [7, 5, 0],
                            lineheight: "30px",
                            fontSize: 20,
                            align: "center",
                        },
                        b: {
                            color: "#03e5fa",
                            fontSize: 20,
                            fontWeight: "bold",
                            padding: [3, 4],
                            align: "left",
                        },
                        per: {
                            fontSize: 20,
                            align: "left",
                        },
                    },
                },
                labelLine: {
                    length: 15,
                    length2: 60,
                    maxSurfaceAngle: 80,
                },
            },
        ],
    });
    // 供热管线-饼图
    const spec2 = ref({
        color: ["#8630f5", "#6eb5ef", "#ffce00"],
        title: {
            text: "供热管网总长度(万km)",
            left: "center",
            textStyle: {
                color: "#fff",
                fontSize: 20,
            },
            padding: 0,
            top: 5,
        },
        tooltip: {
            trigger: "item",
        },
        // legend: {
        //   orient: 'vertical',
        //   left: 'left'
        // },
        series: [
            {
                type: "pie",
                radius: ["40%", "60%"],
                data: [
                    { value: 1048, name: "一级网" },
                    { value: 735, name: "二级网" },
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: "rgba(0, 0, 0, 0.5)",
                    },
                },
                label: {
                    // formatter: '{a|{b}}\n  {b|{c}}{per|万㎡} ',
                    position: "outside",
                    formatter: "{a|{b}}\n  {b|{c}}",
                    backgroundColor: "#0b1c35",
                    borderColor: "inherit",
                    borderWidth: 1,
                    fontSize: 20,
                    borderRadius: 4,
                    rich: {
                        a: {
                            color: "#fff",
                            padding: [7, 5, 0],
                            lineheight: "30px",
                            fontSize: 20,
                            align: "center",
                        },
                        b: {
                            color: "#03e5fa",
                            fontSize: 20,
                            fontWeight: "bold",
                            padding: [3, 4],
                            align: "left",
                        },
                        per: {
                            fontSize: 20,
                            align: "left",
                        },
                    },
                },
                labelLine: {
                    length: 15,
                    length2: 60,
                    maxSurfaceAngle: 80,
                },
            },
        ],
    });
    // 列表
    const tableData = ref([
        {
            question: "问题1问题1问题1问题1问题1问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1问题1问题1问题1问题1问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },

        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },

        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },

        {
            question: "问题1",
            time: "2023",
            data: "POI数据1",
            info: "缺陷明细1",
        },
    ]);

    const setScyy_rq = (flag) => {
        scyy_rq.value = flag;
    };
    const setScyy_gr = (flag) => {
        scyy_gr.value = flag;
    };
    const setSpec = (flag) => {
        spec.value = flag;
    };
    const setSpec2 = (flag) => {
        spec2.value = flag;
    };
    const setTableData = (flag) => {
        tableData.value = flag;
    };

    return {
        scyy_rq,
        scyy_gr,
        spec,
        spec2,
        setScyy_rq,
        setScyy_gr,
        setSpec,
        setSpec2,
        tableData,
        setTableData,
    };
});
